package cn.edu.seig.textbook.service.impl;

import cn.edu.seig.textbook.domain.pojo.Purchases;
import cn.edu.seig.textbook.domain.pojo.Textbooks;
import cn.edu.seig.textbook.mapper.PurchasesMapper;
import cn.edu.seig.textbook.mapper.TextbooksMapper;
import cn.edu.seig.textbook.service.IPurchasesService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author day
 * @since 2024-11-07
 */
@Service
public class PurchasesServiceImpl extends ServiceImpl<PurchasesMapper, Purchases> implements IPurchasesService {
    @Autowired
    private PurchasesMapper purchasesMapper;

    @Autowired
    private TextbooksMapper textbooksMapper;


    @Override
    public List<Textbooks> getTextbooksByStudentName(String studentName){
        return purchasesMapper.getTextbooksByStudentName(studentName);
    }

    @Override
    public List<Purchases> getPurchaseQuantityByStudentName(String studentName){
        return purchasesMapper.getPurchaseQuantityByStudentName(studentName);
    }

    @Override
    public Double getTotalPriceByStudentName(String studentName){
        return purchasesMapper.getTotalPriceByStudentName(studentName);
    }
}
